# Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
# Copyright (C) 2006-2010 RobotCub Consortium
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

# Make sure that YARP_DIR is set in your environment to wherever you
# compiled YARP.

cmake_minimum_required(VERSION 3.12)
project(PortPower)

find_package(YARP COMPONENTS os REQUIRED)

file(GLOB_RECURSE examples *.cpp)

foreach(example ${examples})
  # get name without extension
  get_filename_component(example_we "${example}" NAME_WE)
  add_executable(${example_we})
  target_sources(${example_we} PRIVATE ${example})
  target_include_directories(${example_we} PRIVATE ${PROJECT_SOURCE_DIR})
  target_link_libraries(${example_we} PRIVATE ${YARP_LIBRARIES})
endforeach(example ${examples})
